package cn.huijielong.modules.pub.entity;

import java.util.List;

import net.sf.json.JSONObject;

public class WxTemplate {
	/**
	 * 待付款提醒
	 */
	private final static String TEMPLATE_ID_PAY="Zj3WR-_oRiG1ypm6B5un2VPrfCl7tLQuRCVk-9STr08";
	/**
	 * 款项待收通知
	 */
	private final static String TEMPLATE_ID_RECEIVE="cfsScCgDPSqgc8O5lWp1IARgb2DQsd4ssrFH3Fh0-kE";
	private JSONObject msgJson=new JSONObject();
	
	public WxTemplate(String openid,String templateId,String page,String formId,List<String> data,String emphasisKeyword ) {
		msgJson.accumulate("touser", openid);
		JSONObject weapp_template_msg=new JSONObject();
		msgJson.accumulate("weapp_template_msg", weapp_template_msg);
		JSONObject dataJson=new JSONObject();
		weapp_template_msg.accumulate("data", dataJson);
		
		weapp_template_msg.accumulate("template_id", templateId);
		weapp_template_msg.accumulate("page", page);
		weapp_template_msg.accumulate("form_id", formId);
		weapp_template_msg.accumulate("emphasis_keyword", emphasisKeyword);
		
		for(int i=0;i<data.size();i++) {
			dataJson.accumulate("keyword"+(i+1), new JSONObject().accumulate("value", data.get(i)));
		}
		
	}
	
	public static void penddingPay(String openid,String page,String formId,List<String> data,String emphasisKeyword ) {
		
	}
	public static void penddingReceive() {
		
	}
}
